package lab02.test03;
//定义学生成绩的类
public class Student {
    //属性
    int  computer;
    int math;
    int  english;
    float sumscore;

    //行为
    public double sumscore(){
        return(computer+math+english);
    }
    public double average(){
        return (computer+math+english)/3;
    }
    public float maxscore() {
        float maxscore = computer;
        if (maxscore < english) {
            maxscore = english;
        }
        if (maxscore < math) {
            maxscore = math;
        }
        return maxscore;
    }
    public float minscore(){
        float minscore = computer;
        if (minscore > english) {
            minscore = english;
        }
        if (minscore > math) {
            minscore = math;
        }
        return minscore;
    }
    public void print(){
        System.out.println("该学生的计算机成绩为："+computer);
        System.out.println("该学生的数学成绩为："+math);
        System.out.println("该学生的英语成绩为："+english);

        System.out.println("该学生的成绩总分为："+sumscore());
        System.out.println("该学生的平均成绩为："+average());
        System.out.println("该学生的最高成绩为："+maxscore());
        System.out.println("该学生的最低成绩为："+minscore());
    }

}
